import { _decorator, Component, easing, Label, Node, tween, Vec3 } from 'cc';
import { EleScoreLoad } from './EleScoreLoad';
const { ccclass, property } = _decorator;

@ccclass('PromptScore')
/**
 * 提示分数
 */
export class PromptScore extends Component {

    //分数
    @property(Label)
    private ScoreLabel: Label = null;
    //分数
    @property(Label)
    private ScoreLabel1: Label = null;

    public ElseScoreLoad: Node = null;

    /**
     * 更新分数
     */
    public UpdateScore(_score: number) {
        this.ScoreLabel.string = "+" + _score.toString();
        this.ScoreLabel1.string = "+" + _score.toString();
        this.node.active = true;


        tween(this.ScoreLabel.node).set({ position: new Vec3(0, 0, 0) }).to(0.5, { position: new Vec3(0, 15, 0) }).call(() => {
            this.node.active = false;
            this.ElseScoreLoad.getComponent(EleScoreLoad).NouseArr.push(this.node);
        }).start();
    }

}


